package com.controller;

import com.jfinal.core.Controller;
import com.model.Project;
import com.model.Teacher;

import java.util.List;

/**
 * Created by chaiyuan on 2017/5/6.
 */
public class ProjectController extends Controller {
    public void student(){
        List<Project> list = Project.dao.find("select * from project where status = '1'");
        setAttr("list",list);
        render("/view/student/selected.jsp");
    }
    public void save() {
        Teacher tea = getSessionAttr("user");
        Project project = getModel(Project.class);
        project.set("tea_id", tea.getInt("tea_id"));
        project.save();
        redirect("/teacher");
    }
}
